<template>
    <div>
        <div v-for="i in pp">
            <van-field :label='i.name' v-model="value[i.name]"/>
        </div>
        <van-button @click="add" color="linear-gradient(to right, #ff6034,#7232dd)">添加</van-button>
        
    </div>
</template>

<script>
    export default {
        data(){
            return{
                wid:this.$route.query.id,
                value:{},
                pp:[]
            }
        },
        methods:{
            get_parmas(){
                this.$axios.get('paramsM?wid='+this.wid).then(res=>{
                    this.pp = JSON.parse(res.data.params.params)
                })
            },
            add(){
                console.log(this.value)
                // this.$axios.post('startworkf',{'userid':1,'wid':this.wid,'params':JSON.stringify(this.value)}).then(res=>{
                //     alert('添加成功')
                // })
            }
        },
        mounted(){
            this.get_parmas()
        }
    }
</script>  

<style scoped>

</style>